package com.scorpio.system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.scorpio.common.utils.verification.DefaultGroup;
import lombok.Data;

import javax.validation.constraints.NotEmpty;
import java.util.Date;

@Data
public class SysOss {

    @TableId(type = IdType.AUTO)
    private Long id;

    //上传用户
    private Long userId;

    //关联表ID
    private Long tableId;

    //关联表名
    private String tableName;

    //通途类型 OssUseEnum
    private Integer use_type;

    //连接地址/路径
    @NotEmpty(groups = DefaultGroup.class, message = "文件")
    private String path = "";

    //优先级
    private Integer sort;

    //文件类型 OssTypeEnum
    private Integer fileType;

    //文件后戳
    private String suffix;

    @TableField(exist = false)
    private String url = "";

    //创建时间
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

}
